Skip to content

feat(sdk-core): add removePasskeyFromWallet function#8646

Draft
derranW26 wants to merge 2 commits intomasterfrom
passkey/ticket-5-remove-passkey-from-wallet
Draft

feat(sdk-core): add removePasskeyFromWallet function#8646
derranW26 wants to merge 2 commits intomasterfrom
passkey/ticket-5-remove-passkey-from-wallet

Conversation

@derranW26
Copy link
Copy Markdown
Contributor

Summary

  • Adds removePasskeyFromWallet() to modules/sdk-core/src/bitgo/passkey/
  • Infers coin and keychainId from fetched wallet (walletId-only interface)
  • Verifies wallet passphrase via decrypt() before issuing any DELETE — wrong passphrase aborts cleanly with no side effects
  • DELETEs /api/v2/key/{keychainId}/webauthndevice/{device.id} using MongoDB ObjectId (not credentialId)
  • Exports WebAuthnOtpDevice type stub (to be replaced with @bitgo/public-types once that PR merges)

Test plan

  • Unit: successful passkey removal — verifies decrypt called with correct args, DELETE called with device.id
  • Unit: wrong passphrase — verifies error thrown with lockout message, DELETE NOT called
  • Unit: missing encryptedPrv — verifies descriptive error thrown, no decrypt or DELETE called

TICKET: WCN-190

Pure cryptographic primitives for WebAuthn PRF-based key derivation:
- derivePassword: converts ArrayBuffer PRF result to hex walletPassphrase
- deriveEnterpriseSalt: HMAC-SHA256 via SJCL matching retail implementation exactly

TICKET: WCN-186
@derranW26 derranW26 force-pushed the passkey/ticket-5-remove-passkey-from-wallet branch from 895e229 to f01d766 Compare April 28, 2026 14:38
@derranW26 derranW26 changed the base branch from master to WCN-186/passkey-crypto-package April 28, 2026 14:38
@derranW26 derranW26 changed the base branch from WCN-186/passkey-crypto-package to master April 28, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant